package com.suray.basic.wcs.plc.enums;

public enum SinglePlcDeviceType {
    INVALID(0, "无效"),
    MONOMER_CONVEYOR(1, "单体输送线"),
    MONOMER_CONVEYOR_DOOR(2, "输送线含自动门"),
    MONOMER_CONVEYOR_SHAPE(3, "输送线含外形检测"),
    TURNOVER_MACHINE(4, "翻转机"),
    TURNOVER_MACHINE_CONVERY(5, "翻转机含输送线"),
    TRANS_PLANT_CONVERY(6, "移载输送机"),
    TOOTH_LIFT(7, "牙叉升降机"),
    AUTO_LIFT(8, "自动升降机"),
    AUTO_TRAVERS(9, "自动横移机"),
    ;

    int value;
    String des;
    SinglePlcDeviceType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public static SinglePlcDeviceType parseValue(int value) {
        for (SinglePlcDeviceType singlePlcDeviceType : SinglePlcDeviceType.values()) {
            if (singlePlcDeviceType.value == value) {
                return singlePlcDeviceType;
            }
        }

        return INVALID;
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return des;
    }
}
